package com.dcy;

import com.dcy.dao.StudentDao;
import com.dcy.domain.Student;
import com.dcy.domain.Student2;
import com.dcy.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;
import java.util.Scanner;

public class Starter {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtil.getSqlSession();
        StudentDao studentDao = sqlSession.getMapper(StudentDao.class);
        System.out.println("输入你要查询名字中包含的字：");
        Scanner sc=new Scanner(System.in);
        String s=sc.next();
        String condition="%"+s+"%";//组装条件
        List<Student> studentList = studentDao.selectPart(condition);//传参
        System.out.println(studentList);
    }
}
